def text_to_binary(file_path):
    try:
        with open(file_path, 'r') as file:
            text = file.read()
            print("Original text:", text)
            binary_representation = ' '.join(format(ord(char), '08b') for char in text)
            print("\nBinary representation:", binary_representation)
    except FileNotFoundError:
        print(f"The file {file_path} does not exist.")


if __name__ == "__main__":
    file_path = 'E:\\PycharmProjects\\python_study\\example.txt'
    text_to_binary(file_path)
